﻿namespace EggOfPanKu.Main.Controls
{
    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Text;
    using System.Windows;
    using System.Windows.Controls;
    using System.Windows.Data;
    using System.Windows.Documents;
    using System.Windows.Input;
    using System.Windows.Media;
    using System.Windows.Media.Imaging;
    using System.Windows.Navigation;
    using System.Windows.Shapes;

    using EggOfPanKu.Library.Objects;
    using EggOfPanKu.Library.Infrastructure;
    using EggOfPanKu.Main.Controls;

    /// <summary>
    /// Interaction logic for CardControlStack.xaml
    /// </summary>
    public partial class CardControlStack : UserControl
    {
        #region Fields

        private Card _Card;
        private int _ControlID;

        #endregion Fields

        #region Constructors

        public CardControlStack()
        {
            InitializeComponent();
        }

        public CardControlStack(Card cardInput, string imageRoot)
        {
            Card = cardInput;
            LoadImage(Card.ImagePath);
            InitializeComponent();
        }

        #endregion Constructors

        #region Properties

        public Card Card
        {
            get { return _Card; }
            set { _Card = value; }
        }

        public int ControlID
        {
            get { return _ControlID; }
            set { _ControlID = value; }
        }

        #endregion Properties

        #region Methods

        public void LoadImage(string imagePath)
        {
            CardStackImage.Source = ImageManager.GenerateImageSource(imagePath);
        }

        #endregion Methods
    }
}